//编写工具函数

//截取字符串
export function abbrStr(str: string, length: number) {
    if (str === null) {
        return;
    }
    if (str.length > length) {
        return `${str.substring(0, length)}...`
    }
    return str
}

//获取用户身份
export function getRole(): string | null {
    return sessionStorage.getItem('role')
}

//获取Token
export function getToken(): string | null {
    return sessionStorage.getItem('token')
}